#pragma once

#include "Pages/EditorPageModel.h"
#include "EditorScenePageModel.m.h"

class RScene;
class RSceneNode;

RCLASS(ExtraHeader= ["Scene/Scene.h","Scene/SceneNode.h"])
class REditorScenePageModel : public REditorPageModel
{
    ROBJECT

public:
    virtual TSharedObjectPtr<REditorPageModel> ShareClone(RObject* InOwner) const override;
    virtual SPath GetFilePath() const override
    {
        return FilePath;
    }

    //save the file 
    virtual void LowLevelSave() override;

    virtual TSharedObjectPtr<RObject> GetFocuseObject() const;


    static TSharedObjectPtr<REditorScenePageModel> Create(const SPath& InFilePath,TSharedObjectPtr<RScene> InScene);

    RFIELD()
    TSharedObjectPtr<RScene> Scene;

    RFIELD()
    SPath FilePath;

    void SetSelectedNode(TSharedObjectPtr<RSceneNode> InNode);
    TSharedObjectPtr<RSceneNode> GetSelectedNode() const;
    bool HasSelectedNode() const;

protected:
    RFIELD()
    TSharedObjectPtr<RSceneNode> SelectedNode;

};